#include <bits/stdc++.h>
// 2025/02/05
// tag: 
// Author: Zhang Muen
using namespace std;

using int64 = int64_t;

int n, h, p[101], c[101], dp[100001];

bool check(int money){
    memset(dp, 0, sizeof(dp));
    for (int i = 1; i <= n; i++)
        for (int l = c[i]; l <= money; l++)
            dp[l] = max(dp[l], dp[l - c[i]] + p[i]);
    return dp[money] >= h;
}

signed main()
{
    cin >> n >> h;
    for (int i = 1; i <= n; i++)
        cin >> p[i] >> c[i];
    int l = 0, r = 100000;
    while (l <= r){
        int mid = (l + r) >> 1;
        if (check(mid))
            r = mid - 1;
        else
            l = mid + 1;
    }
    cout << l << endl;
    return 0;
}